package com.web3.management.repository;

import com.web3.management.entity.AccountCredentialLog;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.Collection;
import java.util.List;
import java.util.Optional;

@Repository
public interface AccountCredentialLogRepository extends JpaRepository<AccountCredentialLog, Integer> {

    Optional<AccountCredentialLog> findFirstByAccountIdAndCaptureTypeOrderByCapturedAtDesc(Integer accountId, String captureType);

    List<AccountCredentialLog> findTop10ByAccountIdOrderByCapturedAtDesc(Integer accountId);

    List<AccountCredentialLog> findByAccountIdIn(Collection<Integer> accountIds);
}
